Add --abbrev-commit, --format=oneline and --oneline to the log subcommand#118
Merged
ianthomas23 merged 3 commits intoQuantStack:mainfrom Mar 11, 2026
Merged
Add --abbrev-commit, --format=oneline and --oneline to the log subcommand#118ianthomas23 merged 3 commits intoQuantStack:mainfrom
--abbrev-commit, --format=oneline and --oneline to the log subcommand#118ianthomas23 merged 3 commits intoQuantStack:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
- Coverage 86.83% 86.40% -0.44%
==========================================
Files 60 60
Lines 2340 2420 +80
Branches 275 290 +15
==========================================
+ Hits 2032 2091 +59
- Misses 308 329 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ianthomas23
requested changes
Mar 10, 2026
Member
ianthomas23
left a comment
There was a problem hiding this comment.
Just one change requested, and a note about future work.
JohanMabille
requested changes
Mar 10, 2026
|
|
||
| std::string message = commit.message(); | ||
| while (!message.empty() && message.back() == '\n') | ||
| message.pop_back(); |
Member
There was a problem hiding this comment.
Please add surrounding curly braces
| if (!obj.has_value()) | ||
| { | ||
| throw git_exception("bad revision '" + rev + "'", git2cpp_error_code::BAD_ARGUMENT); | ||
| return; |
Member
There was a problem hiding this comment.
No need for return after throwing
| } | ||
| else | ||
|
|
||
| if (!m_revisions.empty()) |
Member
There was a problem hiding this comment.
I think you can use else if to avoid return statement in the previous if.
| std::cout << git_oid_tostr_s(&oid) << std::endl; | ||
| } | ||
| return; | ||
| } |
Member
There was a problem hiding this comment.
Using else here would avoid the need for the previous return statement
8e664af to
8ff057c
Compare
ianthomas23
requested changes
Mar 11, 2026
ianthomas23
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #91
Add
--abbrev-commit,format=onelineand--onelineto thelogsubcommandAdd
<rev>to therevparsesubcommandAdd
-annotateto thetagsubcommand(The last two ones being useful for the tests)